package business;

import java.util.List;
import java.util.Map;

import dao.IEventDAO;
import dao.JDBCEventDAO;
import domain.Event;

public class BusinessEvent {
	
	public static List<Event> getAllEvents() {
		IEventDAO eventDAO= new JDBCEventDAO();
		return eventDAO.getAllEvents();
	}
	
	public static List<Event> getAllEventsByUser(String loginUser) {
		IEventDAO eventDAO= new JDBCEventDAO();
		return eventDAO.getAllEventsByUser(loginUser);
	}
	
	public static List<Event> getAllEventosByNombre(String nombre) {
		IEventDAO eventDAO= new JDBCEventDAO();
		return eventDAO.getAllEventsByName(nombre);
	}
	
	public static Event getEventById(Integer idEvent) {
		IEventDAO eventDAO= new JDBCEventDAO();
		return eventDAO.getEventById(idEvent);
	}
	
	public static Map<String, String> getAllGuestsByEvent(Integer idEvent){
		IEventDAO eventoDAO= new JDBCEventDAO();
		return eventoDAO.getAllGuestsByEvent(idEvent);
	}
	
	public static void createEvent(Event event){
		IEventDAO eventoDAO = new JDBCEventDAO();
		eventoDAO.createEvent(event);
 	}
	
	public static Integer getLastCreatedEvent(){
		IEventDAO eventoDAO = new JDBCEventDAO();
		return eventoDAO.getLastCreatedEvent();
	}
	
	public static Integer getNumberEventsToUser(Integer idUser) {
		IEventDAO eventoDAO = new JDBCEventDAO();
		return eventoDAO.getNumberEventsToUser(idUser);
	}
	
	public static List<Integer> getEventsWithInvitedUser (Integer idUser){
		IEventDAO eventDAO = new JDBCEventDAO();
		return eventDAO.getEventsWithInvitedUser(idUser);
	}
	
	public static void updateAssistance(String assistance, Integer idEvent, Integer idUser){
		IEventDAO eventDAO = new JDBCEventDAO();
		eventDAO.updateAssistance(assistance, idEvent, idUser);
	}
}
